// pages/shop/shop.js
Page({
  data: {
    param: {}
  },
  onLoad: function (options) {
    var param = wx.getStorageSync('userInfo');
    var that = this
    // 页面初始化 options为页面跳转所带来的参数
    wx.request({   // 获取该店完成的所有定单信息
      url: 'http://1.aiym.applinzi.com/aiyouwai.php',
      data: {
        type: "getStoredemand",
        paras: {
          uid: param.uid
        }
      },
      method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
      header: { "Content-Type": "application/json" }, // 设置请求的 header
      success: function (res) {
        // console.log(res.data)
        that.setData({
          param: res.data
        })
      }
    })
  },
  exit: function () {
    wx.setStorage({
      key: 'userInfo',
      data: null,
      success: function (res) {
        wx.navigateTo({
          url: '../login/login'
        })
      }
    })
  }
})